package com.example.control;


import com.example.feign.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/order")
public class OrderController {

    @Autowired
    private StockService stockService;

    @RequestMapping(value = "/add.json")
    public String add() {
        System.out.println("添加订单!!");
        String result = stockService.deduct();
        return "add order success!! port:"  + result;
    }

    @RequestMapping(value = "/getPort.json")
    public String getPort() {
        System.out.println("获取端口号!!");
        String result = stockService.getPort();
        return "getPort success!! port:"  + result;
    }
}
